cd ..
# position: server
echo "开始导出服务器协议---------"
lua export_proto.lua $@
if [ $? -eq 0 ]; then
    echo "服务器协议导出成功----------"
else
    echo "error: 服务器协议导出失败=========="
    exit 1
fi

echo "\n"

clientRoot=../client
if [ ! -d $clientRoot ]; then
    echo "客户端目录不存在"
    exit 1
fi

cd $clientRoot
echo "开始导出客户端协议--------"
# position: client
npm run export-proto:all
if [ $? -eq 0 ]; then
    echo "客户端协议导出成功-----"
else
    echo "error: 客户端协议导出失败========"
    exit 1
fi